var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var logger = require('morgan');
var http = require('http');
var wstest = require('./wsPart')
app.use(bodyParser.json());
app.use(logger('dev'));
const server = http.createServer(app);

//initialize the WebSocket server instance
wstest(server)
// app.use(express.static(path.join(__dirname, 'public')));

let admin = require('./routes/admin/admin')
let home = require('./routes/home/home')

app.use('/', home);
app.use('/admin', admin);


server.listen(process.env.PORT || 3000, () => {
    console.log(`Server started on port ${3000} :)`);
});